﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using ThreeByte.ActiveDeck.Config;
using PowerPoint = Microsoft.Office.Interop.PowerPoint;
using Office = Microsoft.Office.Core;
using System.Collections.ObjectModel;
using log4net;
using System.ComponentModel;
using ThreeByte.ActiveDeck.Content;

namespace ThreeByte.ActiveDeck.AddIn.Controls.Wizard.Pages
{
    /// <summary>
    /// Interaction logic for ChooseQuestionTypePage.xaml
    /// </summary>
    public partial class ChooseQuestionTypePage : Page, INotifyPropertyChanged
    {
        private static readonly ILog log = LogManager.GetLogger(typeof(ChooseQuestionTypePage));
        private readonly CoreConfig Config;
        private readonly string Question;
        private readonly WorkflowCompleter _workflow;

        public ChooseQuestionTypePage(string question) {
            InitializeComponent();

            Config = WizardMainFrame.ActiveConfig;
            Question = question;
            _workflow = new WorkflowCompleter(this);
        }


        public event PropertyChangedEventHandler PropertyChanged;

        private void NotifyPropertyChanged(string propertyName) {
            if(PropertyChanged != null) {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        private void CannotExecute(object sender, CanExecuteRoutedEventArgs e) {
            e.CanExecute = false;
            e.Handled = true;
        }

        private void HelpExecuted(object sender, ExecutedRoutedEventArgs e) {

        }

        private void ChooseMultipleChoice_Click(object sender, RoutedEventArgs e) {
            NavigationService navService = this.NavigationService;
            if(navService != null) {
                _workflow.Complete();
                navService.Navigate(new MultipleChoiceAnswersPage(Question));
            }
        }

        private void ChooseShortAnswer_Click(object sender, RoutedEventArgs e) {
            NavigationService navService = this.NavigationService;
            if(navService != null) {
                _workflow.Complete();
                navService.Navigate(new QuestionAnswersPage(Question));
            }
        }

        private void ChooseCategory_Click(object sender, RoutedEventArgs e) {
            NavigationService navService = this.NavigationService;
            if(navService != null) {
                _workflow.Complete();
                navService.Navigate(new CategoryAnswersPage(Question));
            }
        }


        
    }
}
